<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
                <!-- Search -->
                <form th:id="form-data" th:action="@{/user/findQuery}" th:object="${user}" method="post">
                    <div class="form-group form-group-bot">
                        <label class="col-sm-1 control-label search-label">用户名</label>
                        <div class="col-sm-3 col-search">
                            <input type="text" class="form-control" th:field="*{userName}" th:autocomplete="off" placeholder="请输入用户名" />
                        </div>
                        <div class="col-sm-1 col-search-btn">
                            <button class="btn btn-sm btn-primary" type="button" onclick="loadSearchData()">查询</button>
                        </div>
                    </div>
                </form>
                <!-- Show Data -->
                <table class="table table-striped table-hover table-bordered">
                    <tr class="text-center">
                        <th class="col-sm-1">#</th>
                        <!--<th class="col-sm-1">头像</th>-->
                        <th class="col-sm-1">用户名</th>
                        <th class="col-sm-1">昵称</th>
                        <th class="col-sm-1">账号状态</th>
                        <!--<th class="col-sm-1">认证状态</th>-->
                        <!--<th class="col-sm-1">密码错误次数</th>-->
                        <!--<th class="col-sm-2">最近登录时间</th>-->
                        <th class="col-sm-2">注册时间</th>
                        <th class="col-sm-1">操作</th>
                    </tr>
                    <tbody>
                        <tr th:each="obj,stat : ${data}">
                            <td th:text="${stat.count}"></td>
                            <!--<td class="text-center"><img class="user-headImg" th:src="#{system.base.url} + ${obj.headImg}" src=""/></td>-->
                            <td th:text="${obj.userName}"></td>
                            <td th:text="${obj.nickName}"></td>
                            <td th:text="${obj.userStateName}"></td>
                            <!--<td th:text="${obj.verifyStateName}"></td>-->
                            <!--<td th:text="${obj.errorTimes}"></td>-->
                            <!--<td th:text="${#dates.format(obj.lastLoginTime, 'yyyy-MM-dd HH:mm:ss')}"></td>-->
                            <td th:text="${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td>
                                <div th:if="${obj.userState == 'LOCKED'}">
                                    <button class="btn btn-sm btn-danger btn-lit" type="button"
                                            th:onclick="'javascript:unlockUser(\'' + ${obj.id} + '\')'">解锁
                                    </button>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="bottom-no-data" th:if="${data.totalPages eq 0}">对不起~没有数据~</div>
                <!-- Pagination -->
                <div th:include="~{common/pagination :: pagin}"></div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/manager/js/user.js}"></script>

